<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateContentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('contents', function (Blueprint $table) {
            $table->increments('content_id')->comment('主键');
            $table->integer('user_id')->comment('用户ID');
            $table->integer('admin_id')->comment('管理员ID');
            $table->integer('category_id')->comment('栏目ID');
            $table->string('username', 20)->comment('发布者姓名');
            $table->integer('order')->comment('排序')->default(0);
            $table->string('style', 15)->comment('标题样式');
            $table->string('thumb', 50)->comment('缩略图');
            $table->string('subject', 255)->comment('标题');
            $table->text('content')->comment('内容');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('contents');
    }
}
